package com.ruoyi.docdemo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.docdemo.mapper.DemoStudentMapper;
import com.ruoyi.docdemo.domain.DemoStudent;
import com.ruoyi.docdemo.service.IDemoStudentService;

/**
 * 学生档案Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-09
 */
@Service
public class DemoStudentServiceImpl implements IDemoStudentService 
{
    @Autowired
    private DemoStudentMapper demoStudentMapper;

    /**
     * 查询学生档案
     * 
     * @param id 学生档案ID
     * @return 学生档案
     */
    @Override
    public DemoStudent selectDemoStudentById(Long id)
    {
        return demoStudentMapper.selectDemoStudentById(id);
    }

    /**
     * 查询学生档案列表
     * 
     * @param demoStudent 学生档案
     * @return 学生档案
     */
    @Override
    public List<DemoStudent> selectDemoStudentList(DemoStudent demoStudent)
    {
        return demoStudentMapper.selectDemoStudentList(demoStudent);
    }

    /**
     * 新增学生档案
     * 
     * @param demoStudent 学生档案
     * @return 结果
     */
    @Override
    public int insertDemoStudent(DemoStudent demoStudent)
    {
        demoStudent.setCreateTime(DateUtils.getNowDate());
        return demoStudentMapper.insertDemoStudent(demoStudent);
    }

    /**
     * 修改学生档案
     * 
     * @param demoStudent 学生档案
     * @return 结果
     */
    @Override
    public int updateDemoStudent(DemoStudent demoStudent)
    {
        demoStudent.setUpdateTime(DateUtils.getNowDate());
        return demoStudentMapper.updateDemoStudent(demoStudent);
    }

    /**
     * 批量删除学生档案
     * 
     * @param ids 需要删除的学生档案ID
     * @return 结果
     */
    @Override
    public int deleteDemoStudentByIds(Long[] ids)
    {
        return demoStudentMapper.deleteDemoStudentByIds(ids);
    }

    /**
     * 删除学生档案信息
     * 
     * @param id 学生档案ID
     * @return 结果
     */
    @Override
    public int deleteDemoStudentById(Long id)
    {
        return demoStudentMapper.deleteDemoStudentById(id);
    }
}
